﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Coot
{
    /// <summary>
    /// Interaction logic for FriendItem.xaml
    /// </summary>
    public partial class FriendItem : UserControl
    {
        private long friendUid;

        public long FriendUid
        {
            get { return friendUid; }
            set { friendUid = value; }
        }

        public string FriendName
        {
            get { return (string)nameLabel.Content; }
            set { nameLabel.Content = value; }
        }

        public bool Selected
        {
            get { return (selectedCheckBox.IsChecked.HasValue && selectedCheckBox.IsChecked.Value); }
            set { selectedCheckBox.IsChecked = value; }
        }

        public bool TaggedSelected
        {
            get { return (taggedCheckBox.IsChecked.HasValue && taggedCheckBox.IsChecked.Value); }
            set { taggedCheckBox.IsChecked = value; }
        }

        public FriendItem()
        {
            InitializeComponent();
        }

        public FriendItem(string name, long uid, bool tagged, bool selected)
        {
            InitializeComponent();

            nameLabel.Content = name;
            friendUid = uid;
            taggedCheckBox.IsChecked = tagged;
            selectedCheckBox.IsChecked = selected;
        }
    }
}
